package com.facishare.open.service;

import com.facishare.open.entity.Blog;
import com.facishare.open.mapper.BlogMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by linchf on 2016/7/25.
 */
@Service
@Slf4j
@Transactional
public class BlogService {
    @Resource
    private BlogMapper blogMapper;

    public List<Blog> getAllBlogs() {
        return blogMapper.getAllBlogs();
    }

    public Blog getBlogById(long id) {
        return blogMapper.getBlogById(id);
    }

    public long insertAndGetId(Blog blog) {
        return blogMapper.insertAndGetId(blog);
    }

    public List<Blog> getBlogsByWhere(Blog blog) {
        return blogMapper.getBlogsByWhere(blog);
    }

}
